.
This commit is contained in:
parent
3c4702b0b0
commit
c593490cec
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.main
|
||||||
|
|
||||||
|
object MeetingResult {
|
||||||
|
const val REFRESH_STATUS = "refresh_status"
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.meetings
|
||||||
|
|
||||||
|
class MeetingIntent {
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.meetings
|
||||||
|
|
||||||
|
class MeetingsAction {
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.meetings
|
||||||
|
|
||||||
|
class MeetingsScreen {
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.meetings
|
||||||
|
|
||||||
|
class MeetingsState {
|
||||||
|
}
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
package ru.myitschool.work.ui.screen.meetings
|
||||||
|
|
||||||
|
class MeetingsViewModel {
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user