Skip to content

Commit

Permalink
feature/Add User ID to Portal User Info
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Nov 8, 2024
1 parent 85833da commit 154865e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion obp-api/src/main/scala/code/snippet/UserInformation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class UserInformation extends MdcLoggable {
private object providerVar extends RequestVar("")
private object devEmailVar extends RequestVar("")
private object usernameVar extends RequestVar("")
private object userIdVar extends RequestVar("")

def show: CssSel = {
if(!AuthUser.loggedIn_?) {
Expand All @@ -52,6 +53,7 @@ class UserInformation extends MdcLoggable {
} else {
val user: User = AuthUser.getCurrentUser.openOrThrowException(attemptedToOpenAnEmptyBox)
usernameVar.set(user.name)
userIdVar.set(user.userId)
devEmailVar.set(user.emailAddress)
providerVar.set(user.provider)
idTokenVar.set(AuthUser.getIDTokenOfCurrentUser)
Expand All @@ -61,7 +63,8 @@ class UserInformation extends MdcLoggable {
"#user-info-provider" #> SHtml.text(providerVar.is, providerVar(_)) &
"#user-info-email" #> SHtml.text(devEmailVar, devEmailVar(_)) &
"#user-info-id-token" #> SHtml.text(idTokenVar, idTokenVar(_)) &
"#user-info-access-token" #> SHtml.text(accessTokenVar, accessTokenVar(_))
"#user-info-access-token" #> SHtml.text(accessTokenVar, accessTokenVar(_)) &
"#user-info-user-id" #> SHtml.text(userIdVar, accessTokenVar(_))
} & "#register-consumer-success" #> ""
}
}
Expand Down
4 changes: 4 additions & 0 deletions obp-api/src/main/webapp/user-information.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ <h1>User Information</h1>
<label for="user-info-access-token">Access Token</label>
<input readonly type="text" id="user-info-access-token" class="form-control" aria-describedby="consumer-registration-app-name-error">
</div>
<div class="form-group">
<label for="user-info-user-id">User ID</label>
<input readonly type="text" id="user-info-user-id" class="form-control" aria-describedby="consumer-registration-app-name-error">
</div>

</div>
</div>
Expand Down

0 comments on commit 154865e

Please sign in to comment.