Skip to content

Commit

Permalink
Merge pull request #184 from Explore-In-HMS/dev
Browse files Browse the repository at this point in the history
CMS-182 Update Master
  • Loading branch information
emineinan authored Aug 12, 2024
2 parents 17dd8ca + 921d1eb commit af83fb9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ import com.hms.lib.commonmobileservices.account.common.Scope
*
* @property familyName The family name of the user.
* @property givenName The given name of the user.
* @property email The email address of the user, can be null if not available.
* @property email The email address of the user.
* @property displayName The display name of the user.
* @property id The unique ID of the user.
* @property photoUrl The URI of the user's profile photo, can be null if not available.
* @property authServiceToken The authentication service token associated with the user.
* @property idToken The ID token associated with the user.
* @property accessToken The access token associated with the user.
* @property scopes The set of scopes granted to the user.
* @property id The unique identifier for the user.
* @property photoUrl The photo URL of the user.
* @property authServiceToken The authentication service token for the user.
* @property idToken The ID token for the user.
* @property accessToken The access token for the user.
* @property scopes The set of granted scopes for the user.
*/
data class SignInUser(
val familyName: String,
val givenName: String,
val familyName: String?,
val givenName: String?,
val email: String?,
val displayName: String,
val id: String,
val displayName: String?,
val id: String?,
val photoUrl: Uri?,
val authServiceToken: String,
val idToken: String,
val accessToken: String,
val scopes: Set<Scope>
val authServiceToken: String?,
val idToken: String?,
val accessToken: String?,
val scopes: Set<Scope>?
)
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ internal class GoogleAccountServiceImpl(private val context: Context, signInPara
val task = GoogleSignIn.getSignedInAccountFromIntent(intent)
task.addOnSuccessListener {
it.email?.let { it1 -> sharedPrefHelper.setEmail(it1) }
signInUser = mapper.map(task.result!!)
signInUser = mapper.map(task.result)
callback.onSuccess(signInUser)
}
task.addOnFailureListener { callback.onFailure(task.exception!!) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ internal class GoogleUserMapper : Mapper<GoogleSignInAccount, SignInUser>() {
* @throws NullPointerException if any required field in GoogleSignInAccount is null.
*/
override fun map(from: GoogleSignInAccount): SignInUser = SignInUser(
familyName = from.familyName!!,
givenName = from.givenName!!,
email = if (from.email == null) "" else from.email,
displayName = from.displayName!!,
id = from.id!!,
photoUrl = from.photoUrl!!,
authServiceToken = if (from.idToken == null) "" else from.idToken!!,
idToken = if (from.idToken == null) "" else from.idToken!!,
familyName = from.familyName,
givenName = from.givenName,
email = from.email,
displayName = from.displayName,
id = from.id,
photoUrl = from.photoUrl,
authServiceToken = from.idToken,
idToken = from.idToken,
accessToken = "",
scopes = getGrantedScopes(from),
scopes = getGrantedScopes(from)
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ internal class HuaweiUserMapper : Mapper<AuthHuaweiId, SignInUser>() {
override fun map(from: AuthHuaweiId): SignInUser = SignInUser(
familyName = from.familyName,
givenName = from.givenName,
email = if (from.email == null) "" else from.email,
email = from.email,
displayName = from.displayName,
id = from.unionId,
photoUrl = from.avatarUri,
authServiceToken = if (from.accessToken == null) "" else from.accessToken,
idToken = if (from.idToken == null) "" else from.idToken,
accessToken = if (from.accessToken == null) "" else from.accessToken,
authServiceToken = from.accessToken,
idToken = from.idToken,
accessToken = from.accessToken,
scopes = getGrantedScopes(from)
)

Expand Down

0 comments on commit af83fb9

Please sign in to comment.