mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-10 11:43:46 +00:00
fix: login (#242)
* password in init user only if needed * reactivate user session * set context AuthorizeClientIDSecret * fix qr code for light * fix copy * check user and org active in auth * add org view provider * handle inactive projects * translate error messages
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/lib/pq"
|
||||
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
token_model "github.com/caos/zitadel/internal/token/model"
|
||||
@@ -39,10 +40,20 @@ func DeleteToken(db *gorm.DB, table, tokenID string) error {
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteTokens(db *gorm.DB, table, agentID, userID string) error {
|
||||
func DeleteSessionTokens(db *gorm.DB, table, agentID, userID string) error {
|
||||
delete := view.PrepareDeleteByKeys(table,
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_AGENT_ID), Value: agentID},
|
||||
view.Key{Key: model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_ID), Value: userID},
|
||||
)
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteUserTokens(db *gorm.DB, table, userID string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_USER_ID), userID)
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
func DeleteApplicationTokens(db *gorm.DB, table string, appIDs []string) error {
|
||||
delete := view.PrepareDeleteByKey(table, model.TokenSearchKey(token_model.TOKENSEARCHKEY_APPLICATION_ID), pq.StringArray(appIDs))
|
||||
return delete(db)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user