mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Allow to authenticate with the same account from different sources
A new config allows to treat an account same independent where it was created (openid or local). Issue: #1827 #1781
This commit is contained in:
@ -204,11 +204,20 @@ object RUser {
|
||||
val t = Table(None)
|
||||
DML.update(
|
||||
t,
|
||||
t.cid === collId && t.uid === userId && t.source === AccountSource.Local,
|
||||
t.cid === collId && t.uid === userId,
|
||||
DML.set(t.password.setTo(hashedPass))
|
||||
)
|
||||
}
|
||||
|
||||
def updateSource(
|
||||
userId: Ident,
|
||||
collId: CollectiveId,
|
||||
source: AccountSource
|
||||
): ConnectionIO[Int] = {
|
||||
val t = Table(None)
|
||||
DML.update(t, t.uid === userId && t.cid === collId, DML.set(t.source.setTo(source)))
|
||||
}
|
||||
|
||||
def delete(user: Ident, coll: CollectiveId): ConnectionIO[Int] = {
|
||||
val t = Table(None)
|
||||
DML.delete(t, t.cid === coll && t.login === user)
|
||||
|
Reference in New Issue
Block a user