mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-17 15:55:26 +01:00
Make sure panic is not thrown when refresh token
Fixes #7695 Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
parent
78aea0920d
commit
c16b44d30b
@ -208,5 +208,9 @@ func RefreshToken(ctx context.Context, token *Token) (*Token, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Token{Token: *t, IDToken: t.Extra("id_token").(string)}, nil
|
||||
it, ok := t.Extra("id_token").(string)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to get id_token from refresh response")
|
||||
}
|
||||
return &Token{Token: *t, IDToken: it}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user