Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanshu committed Dec 7, 2023
1 parent d25675e commit 5ea1d11
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ import com.amplifyframework.statemachine.codegen.states.SetupTOTPState
import com.amplifyframework.statemachine.codegen.states.SignInChallengeState
import com.amplifyframework.statemachine.codegen.states.SignInState
import com.amplifyframework.statemachine.codegen.states.SignOutState
import java.io.IOException
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicReference
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
Expand All @@ -177,13 +184,6 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import java.io.IOException
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicReference
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine

internal class RealAWSCognitoAuthPlugin(
private val configuration: AuthConfiguration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ package com.amplifyframework.auth.cognito.helpers

import com.amplifyframework.auth.cognito.exceptions.service.InvalidParameterException
import com.amplifyframework.auth.exceptions.UnknownException
import org.json.JSONObject
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec

import org.json.JSONObject
internal open class AuthHelper {

companion object {
val HMAC_SHA_256 = "HmacSHA256"
val USERNAME_KEY = "username"
val KEY_USERNAME = "username"

/**
* Generates secret hash. Uses HMAC SHA256.
Expand Down Expand Up @@ -78,7 +77,7 @@ internal open class AuthHelper {
return try {
val header = magicLinkCode.split(".")[0]
val jsonString = android.util.Base64.decode(header, android.util.Base64.NO_WRAP)
JSONObject(jsonString.toString(Charsets.UTF_8)).getString(USERNAME_KEY)
JSONObject(jsonString.toString(Charsets.UTF_8)).getString(KEY_USERNAME)
} catch (e: Exception) {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ object AuthStateJsonGenerator : SerializableProvider {
"CODE_DELIVERY_DESTINATION" to "+12345678900"
)
),
hasNewResponse = false
hasNewResponse = false
)
)
),
Expand All @@ -117,7 +117,7 @@ object AuthStateJsonGenerator : SerializableProvider {
"USERNAME" to "username"
)
),
hasNewResponse = false
hasNewResponse = false
)
)
),
Expand All @@ -139,7 +139,7 @@ object AuthStateJsonGenerator : SerializableProvider {
"USERNAME" to "username"
)
),
hasNewResponse = false
hasNewResponse = false
)
)
),
Expand Down

0 comments on commit 5ea1d11

Please sign in to comment.