diff --git a/MobileAuthApp/app/build.gradle b/MobileAuthApp/app/build.gradle index bc4a034..38896fb 100644 --- a/MobileAuthApp/app/build.gradle +++ b/MobileAuthApp/app/build.gradle @@ -68,8 +68,4 @@ dependencies { 'io.jsonwebtoken:jjwt-gson:0.11.2' implementation 'com.koushikdutta.ion:ion:3.1.0' - - // Retrofit + Moshi Converter - implementation 'com.squareup.retrofit2:converter-moshi:2.9.0' - implementation 'com.squareup.moshi:moshi-kotlin:1.9.3' } \ No newline at end of file diff --git a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenApiService.kt b/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenApiService.kt deleted file mode 100644 index 67b952b..0000000 --- a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenApiService.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.tarkvaraprojekt.mobileauthapp.network - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import retrofit2.Response -import retrofit2.Retrofit -import retrofit2.converter.moshi.MoshiConverterFactory -import retrofit2.http.Body -import retrofit2.http.GET -import retrofit2.http.Headers -import retrofit2.http.POST - -/** - * Class for making HTTP requests - * Based on https://developer.android.com/courses/pathways/android-basics-kotlin-unit-4-pathway-2 - */ -const val BASE_URL = - "https://6bb0-85-253-195-252.ngrok.io" - -private val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build() -private val retrofit = Retrofit.Builder().addConverterFactory(MoshiConverterFactory.create(moshi)) - .baseUrl(BASE_URL).build() - -interface TokenApiService { - @Headers("Content-Type: application/json") - @POST("/auth/authentication") - suspend fun postToken(@Body data: String): Response -} - -object TokenApi { - val retrofitService : TokenApiService by lazy { - retrofit.create(TokenApiService::class.java) - } -} \ No newline at end of file diff --git a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenItem.kt b/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenItem.kt deleted file mode 100644 index b7bb0c1..0000000 --- a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/network/TokenItem.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.tarkvaraprojekt.mobileauthapp.network - -/** - * TokenItem for making POST request. - */ -data class TokenItem ( - val token: String, - val challenge: String, -) \ No newline at end of file