INTO-CPS-Association / DTaaS

:factory: :left_right_arrow: :busts_in_silhouette: Digital Twin as a Service
https://into-cps-association.github.io/DTaaS/
Other
106 stars 51 forks source link

Gitlab logout #479

Open prasadtalasila opened 5 months ago

prasadtalasila commented 5 months ago

The current codebase does not logout of gitlab. Does using oauth revoke API help?

prasadtalasila commented 5 months ago

Even the SessionStorage of the react website is not cleared. This needs to be cleared as well.

The following changes are needed:

  1. Account.jsx - exporting the wrong react component
  2. Authentication.ts - signOut needs to have the required signout functionality. The react-oidc-context package already has
    export declare interface AuthContextProps extends AuthState {
      /**
       * UserManager functions. See [UserManager](https://github.com/authts/oidc-client-ts) for more details.
       */
      readonly settings: UserManagerSettings;
      readonly events: UserManagerEvents;
      clearStaleState(): Promise<void>;
      removeUser(): Promise<void>;
      signinPopup(args?: SigninPopupArgs): Promise<User>;
      signinSilent(args?: SigninSilentArgs): Promise<User | null>;
      signinRedirect(args?: SigninRedirectArgs): Promise<void>;
      signinResourceOwnerCredentials(args: SigninResourceOwnerCredentialsArgs): Promise<User>;
      signoutRedirect(args?: SignoutRedirectArgs): Promise<void>;
      signoutPopup(args?: SignoutPopupArgs): Promise<void>;
      signoutSilent(args?: SignoutSilentArgs): Promise<void>;
      querySessionStatus(args?: QuerySessionStatusArgs): Promise<SessionStatus | null>;
      revokeTokens(types?: RevokeTokensTypes): Promise<void>;
      startSilentRenew(): void;
      stopSilentRenew(): void;
    }

    signouSilent() and revokeTokens() may need to be invoked to complete the signout process.