-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add mongo db support * rename Auth model * Create auth with user type model to store role of user * Add user id * Minor update * Fix detekt build fail
- Loading branch information
Showing
5 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ package com.hrv.mart.authlibrary.model | |
data class AuthResponse ( | ||
val userId: String, | ||
val userType: UserType | ||
) | ||
) |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/hrv/mart/authlibrary/model/AuthWithUserType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.hrv.mart.authlibrary.model | ||
|
||
import org.springframework.data.mongodb.core.mapping.Document | ||
|
||
@Document | ||
data class AuthWithUserType ( | ||
val userId: String, | ||
val userType: UserType | ||
) { | ||
companion object { | ||
fun parseFrom(auth: AppWriteAuth, userType: UserType) = | ||
AuthWithUserType( | ||
userId = auth.userId, | ||
userType = userType | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ package com.hrv.mart.authlibrary.model | |
|
||
enum class UserType { | ||
USER, ADMIN | ||
} | ||
} |