File tree 1 file changed +7
-2
lines changed
static/app/actionCreators
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import {Client} from 'sentry/api';
3
3
import ConfigStore from 'sentry/stores/configStore' ;
4
4
import type { UserIdentityConfig } from 'sentry/types/auth' ;
5
5
import type { User } from 'sentry/types/user' ;
6
+ import { isDemoModeEnabled } from 'sentry/utils/demoMode' ;
6
7
import type { ChangeAvatarUser } from 'sentry/views/settings/account/accountDetails' ;
7
8
8
9
export async function disconnectIdentity (
@@ -46,11 +47,15 @@ export function updateUser(user: User | ChangeAvatarUser) {
46
47
ConfigStore . set ( 'user' , { ...previousUser , ...user , options} ) ;
47
48
}
48
49
49
- export async function logout ( api : Client , redirectUrl = '/auth/login/' ) {
50
+ export async function logout ( api : Client , redirectUrl ?: string ) {
50
51
const data = await api . requestPromise ( '/auth/' , { method : 'DELETE' } ) ;
51
52
52
53
// If there's a URL for SAML Single-logout, redirect back to IdP
53
- window . location . assign ( data ?. sloUrl || redirectUrl ) ;
54
+ window . location . assign ( data ?. sloUrl || getRedirectUrl ( redirectUrl ) ) ;
55
+ }
56
+
57
+ function getRedirectUrl ( redirectUrl = '/auth/login/' ) {
58
+ return isDemoModeEnabled ( ) ? 'https://sentry.io' : redirectUrl ;
54
59
}
55
60
56
61
export function removeAuthenticator ( api : Client , userId : string , authId : string ) {
You can’t perform that action at this time.
0 commit comments