mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 19:16:53 +00:00
Use api user id instead of the provider's id for a user when saving oauth tokens
This commit is contained in:
parent
ac5e218c61
commit
c924cf5be5
@ -88,7 +88,10 @@ object OAuthAuthorisation {
|
||||
//link the token with the concrete API User
|
||||
obpUser.user.obj.map{
|
||||
u => {
|
||||
appToken.userId(u.id_)
|
||||
//Note: ApiUser.id is the database id from ApiUser, as opposed to ApiUser.id_, which returns the id assigned
|
||||
//to this user by its provider (i.e. not this api). We want ApiUser.id because it is unique, unlike the id given by a provider
|
||||
// i.e. two different providers can have a user with id "bob"
|
||||
appToken.userId(u.id.get.toString)
|
||||
}
|
||||
}
|
||||
if (appToken.save())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user