@@ -225,7 +225,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
225
225
const loginWithOAuthApp = useCallback (
226
226
async ( data : LoginOAuthAppOptions ) => {
227
227
const { authOptions, authCode } = await authGitHub ( data ) ;
228
+
228
229
const { token, hostname } = await getToken ( authCode , authOptions ) ;
230
+
229
231
const updatedAuth = await addAccount ( auth , 'OAuth App' , token , hostname ) ;
230
232
setAuth ( updatedAuth ) ;
231
233
saveState ( { auth : updatedAuth , settings } ) ;
@@ -235,7 +237,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
235
237
236
238
const loginWithPersonalAccessToken = useCallback (
237
239
async ( { token, hostname } : LoginPersonalAccessTokenOptions ) => {
238
- await headNotifications ( hostname , token ) ;
240
+ const encryptedToken = ( await encryptValue ( token ) ) as Token ;
241
+ await headNotifications ( hostname , encryptedToken ) ;
242
+
239
243
const updatedAuth = await addAccount (
240
244
auth ,
241
245
'Personal Access Token' ,
@@ -250,10 +254,8 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
250
254
251
255
const logoutFromAccount = useCallback (
252
256
async ( account : Account ) => {
253
- // Remove notifications for account
254
257
removeAccountNotifications ( account ) ;
255
258
256
- // Remove from auth state
257
259
const updatedAuth = removeAccount ( auth , account ) ;
258
260
setAuth ( updatedAuth ) ;
259
261
saveState ( { auth : updatedAuth , settings } ) ;
0 commit comments