Commit 8080927 1 parent a95c5b0 commit 8080927 Copy full SHA for 8080927
File tree 4 files changed +25
-4
lines changed
4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -225,10 +225,15 @@ func (c *ApiController) Logout() {
225
225
user := c .GetSessionUsername ()
226
226
util .LogInfo (c .Ctx , "API: [%s] logged out" , user )
227
227
228
+ application := c .GetSessionApplication ()
228
229
c .SetSessionUsername ("" )
229
230
c .SetSessionData (nil )
230
231
231
- c .ResponseOk (user )
232
+ if application == nil || application .Name == "app-built-in" || application .HomepageUrl == "" {
233
+ c .ResponseOk (user )
234
+ return
235
+ }
236
+ c .ResponseOk (user , application .HomepageUrl )
232
237
}
233
238
234
239
// GetAccount
Original file line number Diff line number Diff line change @@ -72,6 +72,15 @@ func (c *ApiController) GetSessionUsername() string {
72
72
return user .(string )
73
73
}
74
74
75
+ func (c * ApiController ) GetSessionApplication () * object.Application {
76
+ clientId := c .GetSession ("aud" )
77
+ if clientId == nil {
78
+ return nil
79
+ }
80
+ application := object .GetApplicationByClientId (clientId .(string ))
81
+ return application
82
+ }
83
+
75
84
func (c * ApiController ) GetSessionOidc () (string , string ) {
76
85
sessionData := c .GetSessionData ()
77
86
if sessionData != nil &&
Original file line number Diff line number Diff line change @@ -235,8 +235,12 @@ class App extends Component {
235
235
} ) ;
236
236
237
237
Setting . showMessage ( "success" , `Logged out successfully` ) ;
238
-
239
- Setting . goToLinkSoft ( this , "/" ) ;
238
+ let redirectUri = res . data2 ;
239
+ if ( redirectUri !== null && redirectUri !== undefined && redirectUri !== "" ) {
240
+ Setting . goToLink ( redirectUri ) ;
241
+ } else {
242
+ Setting . goToLinkSoft ( this , "/" ) ;
243
+ }
240
244
} else {
241
245
Setting . showMessage ( "error" , `Failed to log out: ${ res . msg } ` ) ;
242
246
}
Original file line number Diff line number Diff line change @@ -147,7 +147,10 @@ class PromptPage extends React.Component {
147
147
if ( res . status === 'ok' ) {
148
148
this . onUpdateAccount ( null ) ;
149
149
150
- const redirectUrl = this . getRedirectUrl ( ) ;
150
+ let redirectUrl = this . getRedirectUrl ( ) ;
151
+ if ( redirectUrl === "" ) {
152
+ redirectUrl = res . data2
153
+ }
151
154
if ( redirectUrl !== "" ) {
152
155
Setting . goToLink ( redirectUrl ) ;
153
156
} else {
You can’t perform that action at this time.
0 commit comments