mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-27 23:55:47 +01:00
Typo and spelling fixes
This commit is contained in:
parent
bdbe9e0817
commit
e12793033d
@ -25,7 +25,7 @@ I started by implementing a `useAuth` composable that would provide both the aut
|
|||||||
|
|
||||||
It consists of the following elements that are placed outside the exported `useAuth`:
|
It consists of the following elements that are placed outside the exported `useAuth`:
|
||||||
|
|
||||||
- `user` ref for storing the currently logged in user. If not logged in, the value is set to `null`
|
- `user` ref for storing the currently logged-in user. If not logged in, the value is set to `null`
|
||||||
- `loadingUserFinished` ref for indicating whether the `loadUser` function, which we'll get to in a minute, has already been executed or not. It's set to `false` by default
|
- `loadingUserFinished` ref for indicating whether the `loadUser` function, which we'll get to in a minute, has already been executed or not. It's set to `false` by default
|
||||||
- `isLoggedIn` computed property that essentially uses double negation on the `user` ref's value to convert it to a boolean
|
- `isLoggedIn` computed property that essentially uses double negation on the `user` ref's value to convert it to a boolean
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ const logIn = (provider: 'github' | 'discord') => {
|
|||||||
|
|
||||||
So, the `logIn` function accepts a single argument for the OAuth provider to use. Then I declare a `redirectPath` constant that we set to the value of the `redirectPath` item inside `localStorage` or `/` if the former is `null`, as well as a rather self-explanatory `permissionScopes` constant. They both appply to read-only user information, with the only difference lying in their names for respective providers.
|
So, the `logIn` function accepts a single argument for the OAuth provider to use. Then I declare a `redirectPath` constant that we set to the value of the `redirectPath` item inside `localStorage` or `/` if the former is `null`, as well as a rather self-explanatory `permissionScopes` constant. They both appply to read-only user information, with the only difference lying in their names for respective providers.
|
||||||
|
|
||||||
Finally, I call the Account SDK's `createOAuth2Session` method with the `provider` argument, successful auth callback URL that, failed auth callback URL and the `permissionScopes` array.
|
Finally, I call the Account SDK's `createOAuth2Session` method with the `provider` argument, successful auth callback URL, failed auth callback URL and the `permissionScopes` array.
|
||||||
|
|
||||||
### loadUser method
|
### loadUser method
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ const logOut = async () => {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### End result
|
### Result
|
||||||
|
|
||||||
AKA what you probably came here for anyway. Enjoy!
|
AKA what you probably came here for anyway. Enjoy!
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ export function useAuth() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Preparing a LogIn view
|
## Preparing the LogIn view
|
||||||
|
|
||||||
### the template
|
### the template
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ Speaking of which, here's how I did it. I opened GitHub and clicked on my profil
|
|||||||
|
|
||||||
I entered my app's name, its home page's URL (ie. `https://racemash.com`), and pasted in that callback URL I mentioned two paragraphs earlier. After submitting the form, I was taken to my GitHub app's settings screen that displayed the app's ID and a button to generate a client secret. I clicked in and copied newly generated secret.
|
I entered my app's name, its home page's URL (ie. `https://racemash.com`), and pasted in that callback URL I mentioned two paragraphs earlier. After submitting the form, I was taken to my GitHub app's settings screen that displayed the app's ID and a button to generate a client secret. I clicked in and copied newly generated secret.
|
||||||
|
|
||||||
Then I returned to my Appwrite project's Dashboard and entered the GitHub app's client ID and the client secret. And that was it - a very straightforwad process.
|
Then I returned to my Appwrite project's Dashboard and entered the GitHub app's client ID and the client secret. And that was it - a very straightforward process.
|
||||||
|
|
||||||
### Configuring Discord OAuth
|
### Configuring Discord OAuth
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user