This commit is contained in:
Egor 2026-02-25 17:58:32 +03:00
parent 3c4702b0b0
commit c593490cec
9 changed files with 29 additions and 0 deletions

View File

@ -57,11 +57,13 @@ object NetworkDataSource {
else if (response.status == HttpStatusCode.Unauthorized) { else if (response.status == HttpStatusCode.Unauthorized) {
error("Неверный логин или пароль") error("Неверный логин или пароль")
} }
Log.e("getToken", response.status.toString())
response.body<String>() response.body<String>()
} }
} }
suspend fun checkAuth(token: String): Result<Boolean> = withContext(Dispatchers.IO) { suspend fun checkAuth(token: String): Result<Boolean> = withContext(Dispatchers.IO) {
return@withContext runCatching { return@withContext runCatching {
Log.e("token", token)
val response = client.get(getUrl(token, Constants.AUTH_URL)) val response = client.get(getUrl(token, Constants.AUTH_URL))
when (response.status) { when (response.status) {
HttpStatusCode.OK -> true HttpStatusCode.OK -> true

View File

@ -1,5 +1,6 @@
package ru.myitschool.work.ui.screen.auth package ru.myitschool.work.ui.screen.auth
import android.util.Log
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer

View File

@ -1,5 +1,6 @@
package ru.myitschool.work.ui.screen.auth package ru.myitschool.work.ui.screen.auth
import android.util.Log
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableSharedFlow

View File

@ -0,0 +1,5 @@
package ru.myitschool.work.ui.screen.main
object MeetingResult {
const val REFRESH_STATUS = "refresh_status"
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.screen.meetings
class MeetingIntent {
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.screen.meetings
class MeetingsAction {
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.screen.meetings
class MeetingsScreen {
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.screen.meetings
class MeetingsState {
}

View File

@ -0,0 +1,4 @@
package ru.myitschool.work.ui.screen.meetings
class MeetingsViewModel {
}