Returns the logout url based on the current authentication method. Returns: str: logout url
()
| 49 | |
| 50 | |
| 51 | def get_logout_url() -> str: |
| 52 | """ |
| 53 | Returns the logout url based on the current authentication method. |
| 54 | |
| 55 | Returns: |
| 56 | str: logout url |
| 57 | """ |
| 58 | BROWSER_INDEX = 'browser.index' |
| 59 | if config.SERVER_MODE and\ |
| 60 | session['auth_source_manager']['current_source'] == \ |
| 61 | KERBEROS: |
| 62 | return _URL_WITH_NEXT_PARAM.format(url_for( |
| 63 | 'kerberos.logout'), url_for(BROWSER_INDEX)) |
| 64 | elif config.SERVER_MODE and\ |
| 65 | session['auth_source_manager']['current_source'] == \ |
| 66 | OAUTH2: |
| 67 | return _URL_WITH_NEXT_PARAM.format(url_for( |
| 68 | 'oauth2.logout'), url_for(BROWSER_INDEX)) |
| 69 | |
| 70 | return _URL_WITH_NEXT_PARAM.format( |
| 71 | url_for('security.logout'), url_for(BROWSER_INDEX)) |
| 72 | |
| 73 | |
| 74 | def socket_login_required(f): |
no outgoing calls
no test coverage detected