@@ -93,31 +93,31 @@ func (c *provider) DeleteSessionForNamespace(namespace string) error {
9393 return nil
9494}
9595
96- // SetMfaSession sets the mfa session with key and value of email
97- func (c * provider ) SetMfaSession (email , key string , expiration int64 ) error {
96+ // SetMfaSession sets the mfa session with key and value of userId
97+ func (c * provider ) SetMfaSession (userId , key string , expiration int64 ) error {
9898 currentTime := time .Now ()
9999 expireTime := time .Unix (expiration , 0 )
100100 duration := expireTime .Sub (currentTime )
101- err := c .store .Set (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , email , key ), email , duration ).Err ()
101+ err := c .store .Set (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , userId , key ), userId , duration ).Err ()
102102 if err != nil {
103103 log .Debug ("Error saving user session to redis: " , err )
104104 return err
105105 }
106106 return nil
107107}
108108
109- // GetMfaSession returns value of given mfa session
110- func (c * provider ) GetMfaSession (email , key string ) (string , error ) {
111- data , err := c .store .Get (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , email , key )).Result ()
109+ // GetMfaSession returns value of given mfa session
110+ func (c * provider ) GetMfaSession (userId , key string ) (string , error ) {
111+ data , err := c .store .Get (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , userId , key )).Result ()
112112 if err != nil {
113113 return "" , err
114114 }
115115 return data , nil
116116}
117117
118118// DeleteMfaSession deletes given mfa session from in-memory store.
119- func (c * provider ) DeleteMfaSession (email , key string ) error {
120- if err := c .store .Del (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , email , key )).Err (); err != nil {
119+ func (c * provider ) DeleteMfaSession (userId , key string ) error {
120+ if err := c .store .Del (c .ctx , fmt .Sprintf ("%s%s:%s" , mfaSessionPrefix , userId , key )).Err (); err != nil {
121121 log .Debug ("Error deleting user session from redis: " , err )
122122 // continue
123123 }
0 commit comments